package top.linyuxb.lycloud.common.mapper;

import org.springframework.jdbc.core.RowMapper;
import top.linyuxb.lycloud.common.po.LyConfigNodePo;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by Intellij IDEA.
 *
 * @Author: linyuxb
 * @Date: 2024/6/17 14:20
 * @Desc:
 */
public class LyConfigNodeMapper implements RowMapper<LyConfigNodePo> {
    @Override
    public LyConfigNodePo mapRow(ResultSet rs, int rowNum) throws SQLException {
        return LyConfigNodePo.builder()
                .id(rs.getLong("id"))
                .env(rs.getString("env"))
                .app(rs.getString("app"))
                .key(rs.getString("key"))
                .value(rs.getString("value"))
                .title(rs.getString("title"))
                .type(rs.getInt("type"))
                .serverInfos(rs.getString("server_infos"))
                .status(rs.getInt("status"))
                .creatorId(rs.getLong("creator_id"))
                .lastModifierId(rs.getLong("last_modifier_id"))
                .ctime(rs.getTimestamp("ctime"))
                .utime(rs.getTimestamp("utime"))
                .build();
    }
}
